package com.lht.designPattern.visitor;

import java.util.Date;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-06-27
 */
public class Employee implements BeVisited{

    private String name;

    private Date entryDate;
    /**
     * 薪资
     */
    private Double salary;

    /**
     * 业绩
     */
    private Double  prefomance;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getEntryDate() {
        return entryDate;
    }

    public void setEntryDate(Date entryDate) {
        this.entryDate = entryDate;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public Double getPrefomance() {
        return prefomance;
    }

    public void setPrefomance(Double prefomance) {
        this.prefomance = prefomance;
    }

    @Override
    public void accepted(Visitor visitor) {
        //作用就是 把引用传给 访问者，让访问者想怎么 显示 就怎么显示
        //最典型就是 类似报表， 总经理看到 是一个样子， 老板关注又和总经理不一样
        visitor.visit(this);
    }

    @Override
    public String  toManager(){
        return "姓名："+name +",入职日期:"+entryDate;
    }

    @Override
    public String toBoss(){
       return  "姓名："+name +",入职日期:"+entryDate+",薪资："+salary+",业绩："+prefomance;
    }
}
